package admin;

import static watij.finders.FinderFactory.*;
import static watij.finders.SymbolFactory.*;
import fit.ColumnFixture;
import util.Login;
import watij.runtime.ie.IE;

public class AddTechnicianTest extends ColumnFixture {

	public String imie;
	public String nazw;
	public String login1;
	public String pass1;
	public String email;
	public String enabled;
	public String nip;
	public String krs;

	public boolean addTechnician() throws Exception {

		IE ie = Login.adminlogin();

		ie.htmlElement(href("manipulateTechnicians.htm")).click();
		ie.htmlElement(href("addTechnicianHome.htm")).click();

		ie.textField(name, "addPersonName").set(this.imie);
		ie.textField(name, "addPersonSurname").set(this.nazw);
		ie.textField(name, "addPersonLogin").set(this.login1);
		ie.textField(name, "addPersonPassword").set(this.pass1);
		ie.textField(name, "addPersonEmail").set(this.email);

		if (this.enabled.equals("true")) {
			ie.checkbox(name, "addPersonEnabled").set();
		}

		ie.textField(name, "addTechnicianNip").set(this.nip);
		
		ie.selectList(name, "addTechnicianRadiologyLab").option(value,this.krs).select();
		
		// dodajemy 
		ie.button("Dodaj").click();
		ie.close();
		return true;
	}
}
